import { GSprite } from "../../../../../com/mui/controls/GSprite";
import { GTextFormat } from "../../../../common/GTextFormat";
import { FontUtil } from "../../../../common/font/FontUtil";
import { ObjCreate } from "../ObjCreate";
import { ImagesConst } from "../../../resource/ImagesConst";
import { GlobalClass } from "../../../../../com/mui/core/GlobalClass";
import { GameDefConfig } from "../../../resource/GameDefConfig";
import { GTextFiled } from "../../../../../com/mui/controls/GTextFiled";
type int = number;
//class MoneyItem
    
    export  class MoneyItem extends GSprite
    {
        constructor()
        {
            super();
            return;
        }

        protected /* override */ createDisposedChildrenImpl(): void
        {
            super.createDisposedChildrenImpl();
            var loc1=new GTextFormat(FontUtil.songtiName, 12, 15859633);
            loc1.align = flash.text.TextFormatAlign.RIGHT;
            this._tfNum = ObjCreate.createTextField("100", 0, 0, 80, 30, this, loc1);
            this._bmpType = ObjCreate.createBitmap(ImagesConst.Tongqian, 80, 0, this);
            return;
        }

        public set unit(arg1: int)
        {
            this._unit = arg1;
            this._bmpType.bitmapData = GlobalClass.getBitmapData(GameDefConfig.instance.getEPrictUnitImg(arg1));
            return;
        }

        public get unit(): int
        {
            return this._unit;
        }

        public set value(arg1: int)
        {
            this._value = arg1;
            this._tfNum.htmlText = arg1.toString();
            return;
        }

        public get value(): int
        {
            return this._value;
        }

        public update(arg1: int, arg2: int): void
        {
            this._tfNum.text = arg1.toString();
            this._bmpType.bitmapData = GlobalClass.getBitmapData(GameDefConfig.instance.getEPrictUnitImg(arg2));
            return;
        }

        protected /* override */ disposeImpl(arg1: Boolean=true): void
        {
            this._tfNum.dispose(arg1);
            ObjCreate.disposeBitmap(this._bmpType, arg1);
            this._tfNum = null;
            this._bmpType = null;
            super.disposeImpl(arg1);
            return;
        }

        protected /* var */_tfNum: GTextFiled;

        protected /* var */_bmpType: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_unit: int;

        /* internal */ /* var */_value: int;
    }
